package org.chen.wordwave.bean;

import androidx.annotation.NonNull;

import org.litepal.LitePal;
import org.litepal.crud.LitePalSupport;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

public class UserInfo extends LitePalSupport implements Serializable {
    private Long id;
    private String googleId;
    private String email;
    private String registerTime;
    private String pwd;
    private String account;
    private Boolean member = false;
    private Date membershipExpiryDate;
    private int points; //积分
    private int totalSignInDays; // 累计签到天数
    private int consecutiveSignInDays; // 连续签到天数
    private String lastSignInDate; // 上次签到日期
    private List<String> signedInDates = new ArrayList<>();//累计签到日期
    private int luckyDrawBtn = 0;
    private Boolean hasDiscountCoupon = false;
    private double discountRate = 1.0;
    private String city;
    private String gender;
    private String ban = "false";
    // 会员类型: 0-非会员，1-积分兑换，2-订阅
    private int membershipType = 0;

    public int getMembershipType() {
        return membershipType;
    }

    public void setMembershipType(int membershipType) {
        this.membershipType = membershipType;
    }

    @NonNull
    @Override
    public String toString() {
        return "UserInfo{" +
                "id=" + id +
                ", email='" + email + '\'' +
                ", registerTime='" + registerTime + '\'' +
                ", pwd='" + pwd + '\'' +
                ", account='" + account + '\'' +
                ", member=" + member +
                ", membershipExpiryDate=" + membershipExpiryDate +
                ", points=" + points +
                ", totalSignInDays=" + totalSignInDays +
                ", consecutiveSignInDays=" + consecutiveSignInDays +
                ", lastSignInDate='" + lastSignInDate + '\'' +
                ", signedInDates=" + signedInDates +
                ", luckyDrawBtn=" + luckyDrawBtn +
                ", hasDiscountCoupon=" + hasDiscountCoupon +
                ", discountRate=" + discountRate +
                ", city='" + city + '\'' +
                ", gender='" + gender + '\'' +
                ", ban='" + ban + '\'' +
                '}';
    }

    public String getGoogleId() {
        return googleId;
    }

    public void setGoogleId(String googleId) {
        this.googleId = googleId;
    }

    public String getBan() {
        return ban;
    }

    public void setBan(String ban) {
        this.ban = ban;
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Boolean isHasDiscountCoupon() {
        return hasDiscountCoupon;
    }

    public void setHasDiscountCoupon(Boolean hasDiscountCoupon) {
        this.hasDiscountCoupon = hasDiscountCoupon;
    }

    public double getDiscountRate() {
        return discountRate;
    }

    public void setDiscountRate(double discountRate) {
        this.discountRate = discountRate;
    }

    public int getLuckyDrawBtn() {
        return luckyDrawBtn;
    }

    public void setLuckyDrawBtn(int luckyDrawBtn) {
        this.luckyDrawBtn = luckyDrawBtn;
    }

    public void resetConsecutiveSignIn() {
        consecutiveSignInDays = 0;
        signedInDates.clear();
    }
    public List<String> getSignedInDates() {
        return signedInDates;
    }
    public void setSignedInDates(List<String> signedInDates) {
        this.signedInDates = signedInDates;
    }
    public int getTotalSignInDays() {
        return totalSignInDays;
    }
    public void setTotalSignInDays(int totalSignInDays) {
        this.totalSignInDays = totalSignInDays;
    }
    public int getConsecutiveSignInDays() {
        return consecutiveSignInDays;
    }
    public void setConsecutiveSignInDays(int consecutiveSignInDays) {
        this.consecutiveSignInDays = consecutiveSignInDays;
    }

    public String getLastSignInDate() {
        return lastSignInDate;
    }

    public void setLastSignInDate(String lastSignInDate) {
        this.lastSignInDate = lastSignInDate;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getRegisterTime() {
        return registerTime;
    }

    public void setRegisterTime(String registerTime) {
        this.registerTime = registerTime;
    }

    public String getPwd() {
        return pwd;
    }

    public void setPwd(String pwd) {
        this.pwd = pwd;
    }

    public String getAccount() {
        return account;
    }

    public void setAccount(String account) {
        this.account = account;
    }

    public Boolean isMember() {
        return member;
    }

    public void setMember(Boolean member) {
        this.member = member;
    }

    public Date getMembershipExpiryDate() {
        return membershipExpiryDate;
    }

    public void setMembershipExpiryDate(Date membershipExpiryDate) {
        this.membershipExpiryDate = membershipExpiryDate;
    }

    public int getPoints() {
        return points;
    }

    public void setPoints(int points) {
        this.points = points;
    }

    public UserInfo() {

    }

    public UserInfo(String email, String registerTime, String pwd) {
        this.email = email;
        this.registerTime = registerTime;
        this.pwd = pwd;
    }

    public UserInfo(String email, String registerTime, String pwd, String account) {
        this.email = email;
        this.registerTime = registerTime;
        this.pwd = pwd;
        this.account = account;
    }

    public UserInfo(String email, String registerTime, String pwd, String account, boolean member, Date membershipExpiryDate, int points) {
        this.email = email;
        this.registerTime = registerTime;
        this.pwd = pwd;
        this.account = account;
        this.member = member;
        this.membershipExpiryDate = membershipExpiryDate;
        this.points = points;
    }
}
